package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.EoExecuteTimetable;
import com.example.demo.entity.ExInfo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author admin
* @description 针对表【ex_info】的数据库操作Mapper
* @createDate 2024-02-19 10:51:35
* @Entity generator.com.example.demo.ExInfo
*/
public interface ExInfoMapper extends BaseMapper<ExInfo> {
    @Select("select * from ex_info where letter_id = #{letterId} ")
    List<ExInfo> selectByLetterId(Long letterId);

    @Select("select * from ex_info where classification_type = 1 and letter_id = #{letterId}")
    List<ExInfo> selectAllByType(Long letterId);

    @Select("select * from ex_info where classification_type =2 and letter_id = #{letterId}")
    List<ExInfo> selectAllBy2Type(Long letterId);

    @Select("select * from ex_info where classification_name =#{classificationName} and letter_id = #{letterId}")
    ExInfo selectByTypeAndName(String classificationName,Integer letterId);

    @Select("select count(*) from ex_info where letter_id = #{letterId} and is_finished != 1")
    Integer selectUnfinished(Integer letterId);
}




